var myCookie = {
	//设置cookie，以及终止日期
	addCookie: function(key, value,expiresTime) {
		document.cookie =key +'=' +value 
	},
	//获取cookie的值，key要获取的cookie的键
	getCookie: function(key) {
		    //获取cookie字符串
		var strCookie = document.cookie
			//切割成数组
		var arrCookies = strCookie.split(';')
			//遍历cookie数组，处理每个cookie对变成单独的数组
		for (var i = 0, len = arrCookies.length; i < len; i++) {
			var arrCookie = arrCookies[i].split('=')
			if (key == arrCookie[0]){
				return unescape(arrCookie[1])
			}else{
				return false
			}
		}
	},
	//删除 cookie---将其过期时间设置为过去
	deleteCookie: function(key,value){
		var date = new Date()
        date = new Date(date -100000000)
        console.log(date)
		document.cookie = key +'=' +value +'; expires='+date
	}
}